package com.fact.utils;

public class PagingUtil {

	public static int getIndex(int index,int recordPerPage)
	{
		return (((index - 1) * recordPerPage) + 1);
	}
	
	public static int getOffset(int recordPerPage)
	{
		return (recordPerPage - 1);
	}
	
	public static int getDiv(int total,int recordPerPage)
	{
		int div = total / recordPerPage;
		if (total % recordPerPage> 0)
			div++;
		return div;
	}
	
}
